home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / comm / mail / YAMscripts.lha / PGPwrite.rexx < prev    next >
OS/2 REXX Batch file  |  1997-05-27  |  1KB  |  47 lines

  1. /* PGPwrite.rexx 1.1 by knikulai@utu.fi - 07-May-97
  2. ** Go check http://www.utu.fi/~knikulai/ARexx.html for other useful scripts!
  3. **
  4. ** The ID/address you give must be such that PGP can find the right public key 
  5. ** 
  6. ** Environment variables PGPPASS and PGPPATH need to be set correctly
  7. */
  8.  
  9. options results
  10. call addlib('rexxreqtools.library',0,-30,0)
  11. call addlib('rexxsupport.library',0,-30,0)
  12.  
  13. scrn='YAMscreen'        /* Change the correct value here or leave it like this*/
  14. editor='c:ed'            /* You probably have a better choice*/
  15. subject='Top secret'        /* You could leave this empty */
  16. outdir='ram:'            /* Message is saved here */
  17. pgp='work:pgp/bin/pgp -sea'    /* Path and encoding options for PGP */
  18.  
  19. id=rtgetstring('',"Enter recipient's ID or address",'PGPencode by knikulai@utu.fi',' Ok | Quit','',s1)
  20. if s1=0 | na='' then exit
  21.  
  22. call delete(outdir'coded.msg')
  23. call delete(outdir'plain.msg')
  24.  
  25.  
  26. address command 
  27. editor outdir'plain.msg'
  28.  
  29. Call Close(STDOUT)
  30. Call Close(STDIN)
  31.  
  32. Call Open(STDOUT,'CON:1/11/638/130/PGP Output/CLOSE/WAIT/SCREEN'scrn,'w')
  33. Call Pragma('*',STDOUT)
  34. Call Open(STDIN,'*')
  35. pgp outdir'plain.msg -o' outdir'coded.msg' id
  36.  
  37. address 'YAM' 
  38. 'Show'
  39. 'MailWrite'
  40. 'WriteSubject "'subject'"'
  41. 'WriteMailTo "'id'"'
  42. 'WriteLetter "'outdir'coded.msg"'
  43. say "You can close the window now"
  44. Call Close(STDOUT)
  45. Call Close(STDIN)
  46. exit
  47.